﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'usp_UPDMS_CAR_REFUELLING_Get_Last_Amount_Per_Liter')
	BEGIN
		DROP Procedure usp_UPDMS_CAR_REFUELLING_Get_Last_Amount_Per_Liter
	END
GO

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
/******************************************************************************
**	Name : usp_UPDMS_CAR_REFUELLING_Get_Last_Amount_Per_Liter
**	Desc : 가장 최근에 등록된 리터당 가격을 조회한다.
**	Test Exec Query : Exec usp_UPDMS_CAR_REFUELLING_Get_Last_Amount_Per_Liter
**	Called by : Car_Dac_UPDMS_CAR_REFUELLING.cs
**	Program ID : Car1011m
**	Auth : 송시명
**	Date : 2010-05-25
*******************************************************************************
**	Change History
*******************************************************************************
**	Date:		Author:		Description:
**	--------	--------	---------------------------------------
**	
*******************************************************************************/
CREATE PROC [dbo].[usp_UPDMS_CAR_REFUELLING_Get_Last_Amount_Per_Liter]
AS
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
SET NOCOUNT ON

SELECT TOP 1 CONVERT(NVARCHAR(50),ucr.Amount_Per_Liter) AS Last_Amount_Per_Liter
  FROM UPDMS_CAR_REFUELLING AS ucr WITH(NOLOCK)
 ORDER BY ucr.Refuelling_Dt DESC

GO